<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name=viewport content="width=device-width,initial-scale=1">
<title>个人中心</title>
<c:if test="${not empty message }">
	<script type="text/javascript">
		alert("${message}");
	</script>
</c:if>
<c:if test="${not empty errorMsg }">
	<script type="text/javascript">
		alert("${errorMsg}");
	</script>
</c:if>

<link rel="stylesheet" href="${ctxStatic}/jiujiudevice/css/public.css" />
<script type="text/javascript"
	src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<script type="text/javascript">
	wx.config({
		debug : false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
		appId : "${weChatAppId}", // 必填，公众号的唯一标识
		timestamp : "${timestamp}", // 必填，生成签名的时间戳
		nonceStr : "${nonceStr}", // 必填，生成签名的随机串
		signature : "${signature}",// 必填，签名，见附录1
		jsApiList : [ 'scanQRCode' ]
	// 必填，需要使用的JS接口列表，所有JS接口列表见附录2
	});
	wx.error(function(res){
	})
</script>

<c:if test="${empty noCashRecord }">
	<script type="text/javascript">
		function scanCode() {
			wx.scanQRCode({
				needResult : 1,// 默认为0，扫描结果由微信处理，1则直接返回扫描结果
				scanType : [ "qrCode", "barCode" ],
				success : function(res) {
					var result = res.resultStr;
					location.href = "${ctxFront }/jiujiudevice/usedevice?deviceSn="
							+ result + "&r=" + Math.random();
				},
				fail : function(res) {
					console.log(res)
					alert(JSON.stringify(res));
	
				}
			});
		}
	</script>
</c:if>
<c:if test="${not empty noCashRecord }">
<script type="text/javascript">
		function scanCode() {
			
			alert("您还未交押金，将自动跳转到押金支付。");
			location.href = "${ctxFront }/jiujiudevice/jiaoyajin";
		}
	</script>
</c:if>
</head>
<body>
	<div class="u-bg">
		<img src="${member.headimgurl}" />
		<p>昵称: ${member.nickname }</p>
		<p style="font-size: 12px;">ID:${member.number }</p>
	</div>
	<div>
		<ul class="u-list">
			<li onclick="scanCode()"><i class="iconfont icon-iconfontscan"
				style="color: #35c1f5;"></i>
				<p>扫一扫</p></li>
			<li onclick="location.href='${ctxFront }/jiujiudevice/myorder'">
				<i class="iconfont icon-quanbudingdan" style="color: #a381fa;"></i>
				<p>订单管理</p>
			</li>
			<li onclick="location.href='${ctxFront }/jiujiudevice/cashManager'">
				<i class="iconfont icon-31hongbao" style="color: #fcd367;"></i>
				<p>押金管理</p>
			</li>
			<li style="display:none;">
				<i class="iconfont icon-tuikuantuihuo"
				style="color: #fc495a;" ></i>
				<p>消费明细</p>
			</li>
			<li style="display:none;">
				<i class="iconfont icon-shezhi1" style="color: #676766;">
				</i>
				<p>账户设置</p>
			</li>
		</ul>
	</div>
</body>
</html>
